﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Security;

namespace Universum.Infrastructure.Security
{
	/// <summary>
	/// Allows the basic operations for a membership
	/// </summary>
	public interface IMembershipService
	{
		/// <summary>
		/// The minimal accepted length
		/// </summary>
		int MinPasswordLength { get; }
		/// <summary>
		/// Validates a user based on the username and password
		/// </summary>
		/// <param name="userName">The username</param>
		/// <param name="password">The password</param>
		/// <returns></returns>
		bool ValidateUser(string userName, string password);
		/// <summary>
		/// Creates a new user with the given values
		/// </summary>
		/// <param name="userName">The username</param>
		/// <param name="password">The password</param>
		/// <param name="email">The email</param>
		/// <returns>Returns a membership creation status</returns>
		MembershipCreateStatus CreateUser(string userName, string password, string email);
		/// <summary>
		/// Changes a user password
		/// </summary>
		/// <param name="userName"></param>
		/// <param name="oldPassword"></param>
		/// <param name="newPassword"></param>
		/// <returns></returns>
		bool ChangePassword(string userName, string oldPassword, string newPassword);
	}
}
